home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Night Owl 6
/
Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso
/
015a
/
do1003.zip
/
COMM.SCR
< prev
next >
Wrap
Text File
|
1991-12-27
|
3KB
|
104 lines
* - Variables ----------------------------------------------------------
* Set these to meet your needs
*
* Times to try redial
/SET Times 3
*
* Default Baud Rate
/SET Baud 9600
*
* Default Phone Number. Used in the /GETS command. You might want to
* substitute the number you call most often.
/SET Default 929-7511
* ----------------------------------------------------------------------
* Display the opening screen. Note the use of the /BOX command to make
* screen fancier.
»c 14 1«DO»re« Simple Communications Script»#«
/box 1 1 80 3 14 3 ""
.go 1 10
:TOP
* Load the COMM.MAC macros. These supply some default key codings
* Use DoMacEd.EXE to examine this file or set your own.
/MACROS 0 COMM.MAC
/GETS Phone Default "»ye«Phone Number (»bo«<enter>»#« »cy«to exit script»ye«):»#« "
/IF %Phone NE "" EXIT
:COMM
.clr go 2 5
»ye«Starting Communications»#«
* NOTE: The InitCommunications command MUST be executed FIRST
/INITCOM 1 %Baud n 8 1 ATM0&M0&D2&C1X4V1E1Q0
*
* Set up the various strings to wait for to detect the modem speed
* This will allow the script to reset the COM: port if the modems
* connect at a speed other than the default. Set these strings
* to those issued by your modem.
/SETWAIT busy BUSY
/SETWAIT connect1200 "CONNECT 1200"
/SETWAIT connect2400 "CONNECT 2400"
/SETWAIT connect9600 "CONNECT 9600"
/SETWAIT NoCarrier "NO CARRIER"
*
:DIAL
*
* Set RedialCount to control the number of times the script attempts
* the number. It is checked against TIMES set above.
/MATH RedialCount 0
*
* A repeat loop is used to control script execution. It will execute
* until RedailCount is greater than or equal to Times or a connection
* is made.
/REPEAT
*
* Dial the phone number. NOTE the addition of "ATDT" to signal to the
* Hayes-compatible modem that it is to dial the number.
/DIAL ATDT%phone
*
* Wait 45 seconds for one of the strings set in the /SETWAIT commands
* above
/WAIT 45
*
* The result of the /WAIT command is placed in the variable "FOUND".
* Check it to make sure that it is equal to one of the connected
* results. (All of them start with "CONNECT" so the like operator
* can be used.
/IF %found LK CONNECT* NoConnect
*
* Eliminate the "CONNECT " part of the string leaving only the
* connect speed. Load this into the variable BAUD and use it
* in the /INITCOM command to reset the modem speed.
/SUBST baud %found "connect " ""
/INITCOM 1 %baud N 8 1
.bell
*
* This starts the actual full-screen terminal session. Press <alt-X>
* to exit terminal mode. Exit the script when done.
/TERM
/GOTO EXIT
*
* If there was no connection, the script branches to this point.
:NOCONNECT
*
* Increment the RedialCount variable and display the result.
/INC RedialCount
»ye«Connection not made »re«%found»ye« (Retries : »gr«%RedialCount(###)»ye«)
»#«
*
* Check RedialCount against Times and if it is greater-than or equal-to
* it, exit the loop. Otherwise go to the command after the /REPEAT
* statement and try again.
/UNTIL %RedialCount(@@@) GE %Times
:EXIT
Terminating Communications
*
* Be sure to use the /CLOSECOM command to remove the communications buffers
* and close the communications down. This is especially important if you
* will continue execution in this or another script.
/CLOSECOM
/ENDEXEC CLEAR
* end of script